package com.tjmc.tiomsresource.sync;

import com.tjmc.tiomsresource.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Luc
 * @version 1.0
 * @date 2020-05-28 16:33
 */
@Service
public class OmcResSyncJob {

    @Autowired
    private CMSbnService cmSbnService;
    @Autowired
    private CMNelService cmNelService;
    @Autowired
    private CMCrdService cmCrdService;
    @Autowired
    private CMPrtService cmPrtService;
    @Autowired
    private CMTplService cmTplService;
    @Autowired
    private CMTnlService cmTnlService;

    @Autowired
    private CMBusiService cmBusiService;

    public void buildTiDBData() {
        //1. 初始化子网表
        cmSbnService.buildTiSubnetToDB();

        //2. 初始化 网元表
        cmNelService.buildAllTiNelsToDB();

        //3. 初始化 板卡
        cmCrdService.buildTiCardToDB();

        //4. 初始化 端口
        cmPrtService.buildTiPortToDB();

        //5. 初始化 拓扑
        cmTplService.buildTiTplToDB2();

        //6. 更新端口对应的Tpl信息
        cmPrtService.correctTplId();

        //7. 初始化业务
        cmBusiService.buildTiBusiToDB();

        //8. 初始化 隧道
        // TODO : 暂时不同步隧道
//        cmTnlService.buildTiTnlToDB();

        //9. 初始化 隧道路径

        //10. 初始化 伪线
    }

}
